QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Binding a tween entry to its receiving track

Listing 5 Binding a tween entry to its receiving track

QTAtomContainer inputMap = nil;

// create an atom container to hold the input map
if (QTNewAtomContainer (&inputMap) == noErr)
{
    QTAtom inputAtom;
    OSType inputType;
    long tweenID = 1;

    // create a kTrackModifierInput atom
    // whose ID is referenceIndex
    QTInsertChild(inputMap, kParentAtomIsContainer,
        kTrackModifierInput, referenceIndex, 0, 0, nil,
        &inputAtom);

    // add a child atom of type kTrackModifierTypeVolume
    inputType = EndianU32_NtoB(kTrackModifierTypeVolume);
    QTInsertChild (inputMap, inputAtom, kTrackModifierType, 1, 0,
     sizeof(inputType), &inputType, nil);

    // add a child atom for the ID of the tween to
    // modify the volume
    QTInsertChild (inputMap, inputAtom, kInputMapSubInputID, 1,
        0, sizeof(tweenID), &tweenID, nil);

    // assign the input map to the sound media
    SetMediaInputMap(GetTrackMedia(soundTrack), inputMap);

    // dispose of the input map
    QTDisposeAtomContainer(inputMap);
}

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |